#version 450

layout (binding = 0) uniform UBO {
	mat4 lightProj;
	mat4 lightView;
    mat4 cameraProj;
	mat4 cameraView;
	vec4 lightData;
} ubo;

layout (binding = 1) uniform sampler2D albedoImage;

layout (push_constant) uniform PushConstants
{
	mat4 model;
	vec3 albedo;
	uint hasTexture;
} pushConstants;

layout (location = 0) in vec3 inPosition;
layout (location = 1) in vec3 inNormal;
layout (location = 2) in vec2 inUV;

layout (location = 0) out vec4 outPosition;
layout (location = 1) out vec4 outNormal;
layout (location = 2) out vec4 outFlux;

void main() {
	outPosition = vec4(inPosition, 1.0);
	outNormal = vec4(inNormal, 1.0);
	vec3 albedo = (pushConstants.hasTexture == 0) ? pushConstants.albedo : texture(albedoImage, inUV).rgb;
	outFlux = vec4(albedo, 1.0);
}